<template>
    <div>
        <div class="i-layout-page-header">
            <PageHeader title="基本信息" hidden-breadcrumb />
        </div>
        <Card :bordered="false" dis-hover class="ivu-mt i-table-no-border">
            <DescriptionList title="员工信息" :col="2">
                <Description term="员工姓名：">{{data.nickName}}</Description>
                <Description term="所属部门：">
                    <span v-if="data.deptName === '1'">研发部</span>
                    <span v-if="data.deptName === '2'">市场部门</span>
                    <span v-if="data.deptName === '3'">财务部门</span>
                    <span v-if="data.deptName === '4'">运维部门</span>
                </Description>
                <Description term="账号：">{{data.account}}</Description>
           </DescriptionList>
            <DescriptionList title="工资信息" :col="2">
                <Description term="基本薪资：">{{data.basicSalary}}</Description>
                <Description term="奖金：">{{data.bonus}}</Description>
                <Description term="午餐补贴：">{{data.lunchSalary}}</Description>
                <Description term="请假扣除：">{{data.leaveDel}}</Description>
                <Description term="加班费：">{{data.overworkAdd}}</Description>
                <Description term="考勤扣除：">{{data.attendanceDel}}</Description>
                <Description term="应发工资：">{{data.allSalary}}</Description>
                <Description term="实发工资：">{{data.shouldSalary}}</Description>
                <Description term="启用时间：">{{data.createDate}}</Description>
           </DescriptionList>
            <Divider />
            <DescriptionList title="五险一金信息" :col="2">
                <Description term="养老金基数：">{{data.pensionBase}}</Description>
                <Description term="养老金比率：">{{data.pensionPer}}</Description>
                <Description term="医疗基数：">{{data.medicalBase}}</Description>
                <Description term="医疗保险比率：">{{data.medicalPer}}</Description>
                <Description term="失业保险基数：">{{data.unempBase}}</Description>
                <Description term="失业保险比率：">{{data.unempPer}}</Description>
                <Description term="工伤保险基数：">{{data.injuryBase}}</Description>
                <Description term="工伤保险比率：">{{data.injuryPer}}</Description>
                <Description term="生育保险基数：">{{data.bithinsuranceBase}}</Description>
                <Description term="生育保险比率：">{{data.bithinsurancePer}}</Description>
                <Description term="公积金基数：">{{data.accumulationFundBase}}</Description>
                <Description term="公积金比率：">{{data.accumulationFundPer}}</Description>
            </DescriptionList>
        </Card>
    </div>
</template>
<script>
    import empSalary from "@/api/finance-empSalary";
    export default {
        data () {
            return {
                data:''
            }
        },
        created() {
            this.getDtail();
        },
        methods:{
            // T和Z时间转换
            changeDate(oldDate) {
                var dateee = new Date(oldDate).toJSON();//这个ie不兼容，会返回1970年的时间
                var date = new Date(+new Date(dateee) + 8 * 3600 * 1000)
                    .toISOString()
                    .replace(/T/g, " ")
                    .replace(/\.[\d]{3}Z/, "");
                return date;
            },
            getDtail(){
                empSalary.getInfoById({
                    sId:this.$route.query.sId
                })
                    .then(res => {
                        // 返回数据
                        this.data = res;
                    })
                    .catch(err => {
                        // 异常情况
                    })
            }
        }
    }
</script>
